package com.hzw.code.extend

import android.app.Activity
import android.content.Intent
import androidx.fragment.app.Fragment
import com.hzw.code.utils.newIntentWithArg

/**
 *
 * @Author:         HuaZhongWei
 * @CreateDate:     2020/4/15 11:15
 *
 * @Description:   Fragment扩展
 *
 */


inline fun <reified T : Activity> Fragment.startActivity(vararg params: Pair<String, Any?>) {
    val intent = newIntentWithArg(params)
    intent.setClass(requireContext(), T::class.java)
    activity?.startActivity(intent)
}